﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmoneyWeiXinEntity;
using EmoneyWeiXinCommon;
using System.Data.SqlClient;
using System.Data;
namespace EmoneyWeiXinDAL
{
    public class ReplyManagerDal
    {
        public static List<ReplyManagerEntity> getReplyManagerList(int weixinid,int hisid)
        {
            SqlParameter[] parameters = new SqlParameter[] {
            new SqlParameter("@weixinid",weixinid),
            new SqlParameter("@hisid",hisid)
            };
            List<ReplyManagerEntity> result = SQLHelper.GetProcedureDataByColumnsLst<ReplyManagerEntity>(Config.EmoneyWeiXin, "sp_ReplyManager_Select", parameters);
            return result;
        }
        public static DataSet getReplyManager_NewsReport_ListByID(int id)
        {
            SqlParameter[] parameters = new SqlParameter[] {
            new SqlParameter("@id",id)
            };
            DataSet result = SQLHelper.ExecuteGetDataSet(Config.EmoneyWeiXin, CommandType.StoredProcedure, "sp_ReplyManager_NewsReport_List", parameters);
            return result;
        }
        public static int UpdateReplyManager(ReplyManagerEntity obj, string newsreportids)
        {
            SqlParameter[] parameters = new SqlParameter[] {
            new SqlParameter("@id" , obj.id),
            new SqlParameter("@weixinid" , obj.weixinid),
            new SqlParameter("@hisid", obj.hisid),
            new SqlParameter("@content", obj.CONTENT),
            new SqlParameter("@createtime", obj.createtime),
            new SqlParameter("@updatetime", obj.updatetime),
            new SqlParameter("@remark", obj.remark),
            new SqlParameter("@newsreportids", newsreportids)
            };
            int result = SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, CommandType.StoredProcedure, "sp_ReplyManager_Update", parameters);
            return result;
        }
        public static int DeleteReplyManager(int id)
        {
            SqlParameter[] parameters = new SqlParameter[] {  
            new SqlParameter("@id", id)};
            int result = SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, CommandType.StoredProcedure, "sp_ReplyManager_Delete", parameters);
            return result;
        }

       
    }
}
